summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNarr the Reg <juangerman-13@hotmail.com>2023-05-22 21:13:50 +0200
committerGitHub <noreply@github.com>2023-05-22 21:13:50 +0200
commite8a025b4f815420a61b2ae6d2b2cf49a2d22fb8c (patch)
treed7a24c68e10373d3fd99bfe6beef06ed041b78af
parentMerge pull request #10392 from danilaml/update-cubeb-again (diff)
parentinput_common: Map motion with relative values not absolute ones (diff)
downloadyuzu-e8a025b4f815420a61b2ae6d2b2cf49a2d22fb8c.tar
yuzu-e8a025b4f815420a61b2ae6d2b2cf49a2d22fb8c.tar.gz
yuzu-e8a025b4f815420a61b2ae6d2b2cf49a2d22fb8c.tar.bz2
yuzu-e8a025b4f815420a61b2ae6d2b2cf49a2d22fb8c.tar.lz
yuzu-e8a025b4f815420a61b2ae6d2b2cf49a2d22fb8c.tar.xz
yuzu-e8a025b4f815420a61b2ae6d2b2cf49a2d22fb8c.tar.zst
yuzu-e8a025b4f815420a61b2ae6d2b2cf49a2d22fb8c.zip
-rw-r--r--src/input_common/input_engine.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/input_common/input_engine.cpp b/src/input_common/input_engine.cpp
index 91aa96aa7..e4c5b5b3c 100644
--- a/src/input_common/input_engine.cpp
+++ b/src/input_common/input_engine.cpp
@@ -380,13 +380,16 @@ void InputEngine::TriggerOnMotionChange(const PadIdentifier& identifier, int mot
if (!configuring || !mapping_callback.on_data) {
return;
}
+ const auto old_value = GetMotion(identifier, motion);
bool is_active = false;
- if (std::abs(value.accel_x) > 1.5f || std::abs(value.accel_y) > 1.5f ||
- std::abs(value.accel_z) > 1.5f) {
+ if (std::abs(value.accel_x - old_value.accel_x) > 1.5f ||
+ std::abs(value.accel_y - old_value.accel_y) > 1.5f ||
+ std::abs(value.accel_z - old_value.accel_z) > 1.5f) {
is_active = true;
}
- if (std::abs(value.gyro_x) > 0.6f || std::abs(value.gyro_y) > 0.6f ||
- std::abs(value.gyro_z) > 0.6f) {
+ if (std::abs(value.gyro_x - old_value.gyro_x) > 0.6f ||
+ std::abs(value.gyro_y - old_value.gyro_y) > 0.6f ||
+ std::abs(value.gyro_z - old_value.gyro_z) > 0.6f) {
is_active = true;
}
if (!is_active) {